//
//  YLRegularFinancingHeader.m
//  YLFinanceService
//
//  Created by she1323 on 2017/9/13.
//  Copyright © 2017年 she1323. All rights reserved.
//  合同编号

#import "YLRegularFinancingHeader.h"
#import <Masonry.h>
#import "YLRegularFinancingDetailModel.h"
@interface YLRegularFinancingHeader ()
@property (nonatomic, weak) UILabel *contentLabel;
@end

@implementation YLRegularFinancingHeader

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        [self setUp];
    }
    return self;
}

- (void)setModel:(YLRegularFinancingDetailModel *)model
{
    _model = model;
    _contentLabel.text = model.contractCode;
    
}

- (void)setUp
{
    __weak typeof(self) weakSelf = self;
    
    UIImageView *imageView = [[UIImageView alloc] init];
    imageView.image = [UIImage imageNamed:@"redBase"];
    [self addSubview:imageView];
    [imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.right.left.bottom.mas_equalTo(weakSelf);
    }];
    
    
    UILabel *titleLabel = [[UILabel alloc] init];
    titleLabel.text = @"合同编号";
    titleLabel.textColor = [UIColor whiteColor];
    titleLabel.font = [UIFont systemFontOfSize:15.0f];
    titleLabel.alpha = 0.8;
    [self addSubview:titleLabel];
    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(weakSelf).mas_offset(20);
        make.centerX.mas_equalTo(weakSelf);
    }];
    
    UILabel *contentLabel = [[UILabel alloc] init];
    _contentLabel = contentLabel;
    //contentLabel.text = @"YDBBHHSDFKJ";
    contentLabel.textColor = [UIColor whiteColor];
    contentLabel.font = [UIFont boldSystemFontOfSize:19.0f];
    [self addSubview:contentLabel];
    [contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(weakSelf).mas_offset(-10);
        make.centerX.mas_equalTo(weakSelf);
    }];
    
}

@end
